package com.cy3;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;

public class ArraylistToFile {
    public static void main(String[] args) throws IOException {
        ArrayList<String> arr = new ArrayList<>();
        arr.add("陈勇");
        arr.add("美女");
        arr.add("老婆");
        BufferedWriter bw = new BufferedWriter(new FileWriter("myCharStream\\arrar.txt"));
        for (String s : arr) {
            bw.write(s);
            bw.newLine();
            bw.flush();
        }
        bw.close();


    }
}
